package com.dao;

import com.pojo.Dep;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface DepDAO extends JpaRepository<Dep,Integer> {

     @Query(value = "select *  from Dep d where (?1 is null or d.depId=?1 ) and (?2 is null or d.depName like ?2)",nativeQuery = true)
     Page<Dep> search(Integer depId, String depName, Pageable page);
}
